<template>
	<view class="add-btn" @click="add" >
		<view class="iconfont icon-jiahao ic"></view>
	</view>
</template>

<script>
	
	export default {
		props: {
			tab: { // 0添产品 1添加排产
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				urls: ['../../pages/add-product/add-product', 
				'../../pages/add-product-scheduling/add-product-scheduling'],
				index: this.tab
			}
		},
		methods: {
			add() {
				if(this.tab == 0) { // 跳到添加产品页
					uni.navigateTo({
						url: this.urls[this.index]+'?gid=-1'
					})
					// console.log('add')
				}else {
					uni.navigateTo({
						url: this.urls[this.index]
					})
					// console.log('add')
				}
				
			},
		},
		components: {
			
		}
	}
</script>

<style lang="less" scoped>
	.add-btn {
		position: fixed;
		bottom: 67rpx;
		right: 23rpx;
		width: 80rpx;
		height: 80rpx;
		border-radius: 70rpx;
		// border: 3px solid #b1c4fc;
		background-color: #1989fa;
		z-index: 999;
		text-align: center;
		line-height: 80rpx;
		box-shadow: 0 0 7px 3px rgba(0,0,0,.1);
		
		.ic {
			font-size: 78rpx;
			color: #FFF;
			font-weight: 700;
		}
	}
</style>